package mysql

import (
	"cloud_note/config"
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
)

var (
	err error
	db  *gorm.DB
)

func Init() {
	conf := config.GetConf()
	//fmt.Println("d: ", conf.Drive)
	//fmt.Println("a: ", conf.MysqlAddr)
	db, err = gorm.Open(conf.Drive, conf.MysqlAddr)
	if err != nil {
		panic(err)
	}
	//defer db.Close()
}
